package com.oocl.mavendemo.test;

public class TwoPointFind {
	public int twoPointFind(int[] num,int start,int end,int key){
		int mid=(end-start)/2+start;
		if(num[mid]==key){
			return mid;
		}
		else if(start>=end){
			return -1;
		}
		else if(key>num[mid]){
			return twoPointFind(num,mid+1,end,key);
		}
		else if(key<num[mid]){
			return twoPointFind(num,start,mid+1,key);
		}
		return -1;
		
	}
}
